<?php
class Database {
	private $mDatabaseName = null;
	private $mConn = null;
	private $mLanguageId = 25;

	function __construct($database = null, $languageId = 25) {
		$this->mDatabaseName = $database;
		$this->mLanguageId = $languageId;

		try {
			$this->mConn = new PDO("sqlite:" . $this->mDatabaseName);
		}
		catch (PDOException $e) {
			print_r($e);
		}
	}

	public function query($query = "", $params = array()) {
		$result = array();

		try {	
			$stm = $this->mConn->prepare($query);
			$stm->execute($params);

			return $stm->fetchAll(PDO::FETCH_ASSOC);
		}
		catch (PDOException $e) {
			print_r($e);
		}

		return array();
	}
}
?>
